package com.yili.oa.dao;

import com.yili.oa.models.FtCustomerService;
import com.yili.oa.models.FtCustomerServiceExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface FtCustomerServiceMapper {
    @SelectProvider(type=FtCustomerServiceSqlProvider.class, method="countByExample")
    long countByExample(FtCustomerServiceExample example);

    @DeleteProvider(type=FtCustomerServiceSqlProvider.class, method="deleteByExample")
    int deleteByExample(FtCustomerServiceExample example);

    @Delete({
        "delete from ft_customer_service",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into ft_customer_service (id, type, ",
        "contact, create_time)",
        "values (#{id,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, ",
        "#{contact,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT})"
    })
    int insert(FtCustomerService record);

    @InsertProvider(type=FtCustomerServiceSqlProvider.class, method="insertSelective")
    int insertSelective(FtCustomerService record);

    @SelectProvider(type=FtCustomerServiceSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="contact", property="contact", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.BIGINT)
    })
    List<FtCustomerService> selectByExample(FtCustomerServiceExample example);

    @Select({
        "select",
        "id, type, contact, create_time",
        "from ft_customer_service",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="type", property="type", jdbcType=JdbcType.INTEGER),
        @Result(column="contact", property="contact", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.BIGINT)
    })
    FtCustomerService selectByPrimaryKey(Long id);

    @UpdateProvider(type=FtCustomerServiceSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") FtCustomerService record, @Param("example") FtCustomerServiceExample example);

    @UpdateProvider(type=FtCustomerServiceSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") FtCustomerService record, @Param("example") FtCustomerServiceExample example);

    @UpdateProvider(type=FtCustomerServiceSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(FtCustomerService record);

    @Update({
        "update ft_customer_service",
        "set type = #{type,jdbcType=INTEGER},",
          "contact = #{contact,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=BIGINT}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(FtCustomerService record);
}